Skip to content

fix(release): run the musl candidate as the host user inside the Alpine adapter - #2684

Merged
namastex888 merged 7 commits into
mainfrom
fix/musl-host-uid
Jul 26, 2026
Merged

namastex888 merged 7 commits into
mainfrom
fix/musl-host-uid

Conversation

@automagik-genie

@automagik-genie automagik-genie commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

One platform from a fully green chain

Run 30218355227 (v5.260726.9): darwin, glibc, and linux-arm64 dogfood all passed the complete real-Codex N→T lifecycle on CI for the first time ever. musl failed at genie init must be run inside a git repository.

Root cause

The Alpine container runs as root while the bind-mounted fixture tree is owned by the host runner uid. Git refuses a repository whose on-disk owner differs from the effective uid (dubious ownership) — so N's genie init sees no repository. And even with a git override, every file the container created as root would poison later host-side stages against genie's own fail-closed stat.uid ownership checks — the fixture tree is deliberately shared between container-side CLI stages and host-side Codex/MCP stages.

Fix

Root exists only for the apk bootstrap. Install su-exec alongside it and drop to the exact host uid:gid (passed via DOGFOOD_HOST_UID/GID) for the candidate exec — restoring the same identity model the three host-native platforms pass under.

Evidence

Verified against the exact pinned alpine digest with no-new-privileges active: su-exec 1001:1001 id -u → 1001, and git rev-parse accepts a matching-owner repository (the exact failing combination). Adapter unit tests pin the env pair and the su-exec drop; bash -n and lint clean.

Main-first as before (the dogfood job executes the adapter from main); dev twin follows so its merge fires the release.

Summary by CodeRabbit

  • New Features

    • Added automated smoke checks for the musl adapter, including output validation, stateful operation, and database file ownership checks.
    • Musl adapter dogfood runs now execute under the host user’s identity, improving file permission behavior.
  • Bug Fixes

    • Prevented container-created files from being owned by root during musl adapter runs.
  • Chores

    • Updated the package and plugin version from 5.260726.7 to 5.260726.9.

automagik-genie and others added 6 commits July 26, 2026 16:30
fix(release): dogfood runner environment fixes (dev twin of #2676)
fix(release): musl adapter stderr hygiene (dev twin)
…ne adapter

Run 30218355227 (v5.260726.9): darwin, glibc, and linux-arm64 dogfood
all passed the full real-Codex lifecycle for the first time; musl failed
at 'genie init must be run inside a git repository'.

The container ran as root while the bind-mounted fixture tree is owned
by the host runner. Git refuses a repository whose on-disk owner differs
from the effective uid (dubious ownership), so N's genie init reported
no repository; and even past git, every file the container created as
root would poison later host-side stages against genie's fail-closed
stat.uid ownership checks.

Root is needed only for the apk bootstrap. Install su-exec alongside it
and drop to the exact host uid:gid (passed via DOGFOOD_HOST_UID/GID) for
the candidate exec — the same identity model the three host-native
platforms pass under. Verified against the pinned alpine digest with
no-new-privileges active: su-exec drops to the target uid and git
accepts a matching-owner repository.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 23619eeb-1432-4fa5-8e5f-7938c43c0726

📥 Commits

Reviewing files that changed from the base of the PR and between b2d9c3b and 8a457c4.

📒 Files selected for processing (9)
  • .claude-plugin/marketplace.json
  • .github/workflows/musl-adapter-smoke.yml
  • package.json
  • plugins/genie/.claude-plugin/plugin.json
  • plugins/genie/.codex-plugin/plugin.json
  • plugins/genie/package.json
  • plugins/hermes-genie/plugin.yaml
  • scripts/run-musl-dogfood.sh
  • scripts/run-musl-dogfood.test.ts

📝 Walkthrough

Walkthrough

Changes

Release metadata

Layer / File(s) Summary
Version metadata update
.claude-plugin/marketplace.json, package.json, plugins/genie/*, plugins/hermes-genie/plugin.yaml
All Genie package and plugin manifests are updated from version 5.260726.7 to 5.260726.9.

Musl adapter identity validation

Layer / File(s) Summary
Host-identity candidate execution
scripts/run-musl-dogfood.sh, scripts/run-musl-dogfood.test.ts
The Alpine dogfood container passes host UID/GID values to su-exec, runs the candidate under that identity, and tests the generated command.
Musl smoke workflow validation
.github/workflows/musl-adapter-smoke.yml
A pull-request workflow probes the previous-stable adapter, performs stateful dogfood seeding, and verifies genie.db ownership.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant Alpine
  participant Adapter
  participant Repository
  participant Database
  GitHubActions->>Alpine: pull pinned Alpine image
  GitHubActions->>Adapter: download previous-stable musl binary
  Alpine->>Adapter: run --version probe
  GitHubActions->>Repository: seed repository through run-musl-dogfood.sh
  Adapter->>Database: create genie.db
  GitHubActions->>Database: verify host runner ownership
Loading

Possibly related PRs

Suggested reviewers: namastex888

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Accurately summarizes the main behavior change: the Alpine musl adapter now runs the candidate as the host user.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/musl-host-uid

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…every touching PR

The adapter historically executed only inside production release dogfood
jobs, so each adapter defect cost a full release cycle to discover
(pull-progress stderr on the strict probe, container-root git ownership).
This smoke runs on any PR touching the adapter, on a real amd64 runner:

- probe mode (no DOGFOOD_ROOT): --version must exit 0 with a byte-empty
  stderr, pinning the bootstrap-silence contract verifyCapability enforces
- stateful mode: git init + genie init + task create + board through the
  container as the host uid — the exact leg that failed in v5.260726.9 —
  plus an ownership assertion on the seeded database

Local replay of this leg is impossible on Apple Silicon (the x86_64 Bun
binary requires AVX and dies under emulation), which is precisely why the
adapter kept costing release cycles: this closes that gap permanently.
@namastex888
namastex888 merged commit 19bd36a into main Jul 26, 2026
26 checks passed
@automagik-genie
automagik-genie deleted the fix/musl-host-uid branch September 25, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants